﻿@{
    ViewBag.Title = "ThemLoaiHang";
    Layout = "~/Views/Shared/_Admin_Layout.cshtml";
}
@model CoffeeBar.Models.LoaiMatHangModels
<div id="themloaihang" >
<div style="width: 100%; height: 35px; margin: 0 auto; text-align:center; font-size:medium">
<h1 style="width: 100%; height: 35px; margin: 0 auto; text-align:center; font-size:medium">---XEM THÔNG TIN VỀ LOẠI HÀNG---</h1>
</div>
<style>
    div#themloaihang
    {
        width:100%;
        height:auto;
        margin: 0 auto;
    }
    div#show-items
    {
        width:98%;
        height:auto;
        margin: 0 auto;
        padding: 20px 0px;
    }
    div#show-items ul
    {
        padding-left: 10px;
        border: 1px solid black;
    }
    div#show-items ul li
    {
        display:inline;      
        font-size:medium;
    }
</style>
<div id="show-items" >
<ul>
<li style="width: 15%;float: left;margin-left: 0px;text-align:center;">Tác vụ    | </li>
<li style="width: 63%;margin-left: 50px;text-align:center;"> Tên Loại Hàng     |   </li>
<li style="width: 20%;float: right;margin-right: 10px;text-align:center;"> Mã Định Danh  </li>
</ul>
@if (ViewData["dsloaihang"] != null)
{
    var temp = ViewData["dsloaihang"] as List<CoffeeBar.Models.LoaiMatHang.LoaiHang>;
    foreach (var item in temp)
    {
        <ul>
        <li style="width: 15%;float: left;margin-left: 0px;"> @Html.ActionLink("Edit", "EditLoaiHang", new {  id=item.maloaihang, item_name=item.tenloaihang} ) |  
        @Html.ActionLink("Delete", "DeleteLoaiHang", new { id = item.maloaihang }) </li>      
        <li style="width: 63%;margin-left: 30px;text-align:left;">@item.tenloaihang </li>
        <li style="width: 20%;float: right;margin-right: 10px; text-align:right"> @item.maloaihang</li>
        </ul>
    }
}
</div>
<style>
    div#add-pro
    {
        width:80%;
        height:auto;
        margin:0 auto;
        padding:5px;
    }
</style>
<div id="add-pro">
<h2 style="width:100%; height:auto; margin:0 auto; text-align:center;">---THÊM LOẠI HÀNG MỚI---</h2>
@using (Html.BeginForm("ThemLoaiHang", "Quanlyhanghoa", FormMethod.Post))
{
    <div>
    @if (ViewData["error"] != null)
    {
        <h1>@ViewData["error"]</h1>
    }
    </div>
    <div>
    <p>@Html.Label("Thêm loại hàng mới :") 
    @Html.TextBoxFor(m => m.TenLoaiMatHang)
    <input type="submit" name="submit" value=" Thêm "/>
    </p>
    </div>
}
</div>
</div>